import json

from scrapy import Request
from scrapy_redis.spiders import RedisSpider


class RedisSpiderPro(RedisSpider):

    def make_requests_from_url(self, url):
        headers = {
            'Content-Type': 'application/json',
            'X-Requested-With': 'XMLHttpRequest'
        }
        url = url + '&type=list'
        return Request(url=url, method='POST', headers=headers, body=json.dumps({}), dont_filter=True)
